%!PS-Adobe-3.0
%%Title: examples/logic8
%%Creator: Xcircuit v3.1
%%CreationDate: Tue Apr 29 14:39:02 2003
%%Pages: 3
%%BoundingBox: 110 290 502 502
%%DocumentNeededResources: font Times-Roman 
%%EndComments
%%BeginProlog
%
%  PostScript prolog for output from xcircuit
%  Version: 2.4
%
%  Electrical circuit (and otherwise general) drawing program
%
%  Written by Tim Edwards 8/5/93--1/15/03  (tim@bach.ece.jhu.edu)
%  The Johns Hopkins University
%
%%BeginResource: procset XCIRCproc 2.4 2
% supporting definitions --- these are the primary xcircuit types.

/XCIRCsave save def
/topmat matrix currentmatrix def

/fontslant { /slant exch def [1 0 slant 1 0 0] 
    exch findfont exch makefont dup length dict /ndict exch def
    { 1 index /FID ne { ndict 3 1 roll put } { pop pop } ifelse } forall
    ndict definefont pop} def
/ul { dup type /stringtype eq showflag 1 eq and { gsave 
   currentpoint topmat setmatrix 0 0 moveto 2 index stringwidth pop (_)
   false charpath flattenpath pathbbox grestore exch pop 1 index
   sub setlinewidth exch pop currentpoint 3 -1 roll add moveto 0
   rlineto stroke moveto } if } def
/ol { dup type /stringtype eq showflag 1 eq and { gsave gsave
   currentpoint topmat setmatrix 2 index stringwidth pop 3 index
   true charpath flattenpath pathbbox grestore exch pop
   exch pop topmat setmatrix (_) true charpath pathbbox grestore
   exch pop 1 index sub setlinewidth exch pop currentpoint
   exch 4 1 roll exch sub add moveto pop 0 rlineto stroke
   moveto } if } def
/stW { gsave currentpoint newpath moveto true charpath flattenpath
	pathbbox pop exch pop sub grestore } def
/Ts {mark Tabs aload pop counttomark 1 add array astore /Tabs exch def Tabs
	0 currentpoint pop put} def
/Tbn {mark Tabs aload pop counttomark dup 2 add 1 roll cleartomark 1 sub} def
/Tb { 0 1 Tbn {Tabs exch get dup currentpoint pop lt
	{currentpoint exch pop moveto exit} {pop} ifelse } for } def
/Tf { Tbn -1 0 {Tabs exch get dup currentpoint pop gt
	{currentpoint exch pop moveto exit} {pop} ifelse } for } def
/qS { (aa) stW (a a) stW sub 4 div 0 Kn } def
/hS { qS qS } def
/pspc 0 def
/cf0 { scalefont setfont } bind def
/Kn { dup kY add /kY exch def rmoveto } bind def
/ss { /fscale fscale 0.67 mul def currentfont 0.67 cf0 0 fscale0 fscale mul
	0.33 mul neg Kn} def
/Ss { /fscale fscale 0.67 mul def currentfont 0.67 cf0 0 fscale0 fscale mul
	0.67 mul Kn } def
/ns { 0 kY neg Kn /kY 0 def /fscale 1.0 def xfont0 1.0 cf0 } def
/CR { ns 0 /Bline Bline fscale0 neg add def Bline moveto } def
/cf { dup type /realtype ne {1.0} if exch findfont exch kY 0 eq
	{ 40 mul dup /fscale0 exch def cf0 /xfont0 currentfont def}
	{fscale0 mul fscale mul cf0} ifelse } def
/ctmk { counttomark dup 2 add -1 roll pop } bind def
/label { gsave translate 0 0 moveto dup scale neg /rotval exch def
	/just exch def just 16 and 0 gt {gsave rotval rotate 0 1 dtransform
	gsave pagemat setmatrix idtransform exch grestore 1 0 dtransform
	gsave pagemat setmatrix idtransform exch grestore dup abs 1e-9 lt
	{pop mul 0 gt} {3 1 roll pop pop 0 lt} ifelse grestore {-1 /rotval
	rotval neg def /just just dup 3 and 1 ne {3 xor} if def} {1} ifelse
	exch -1e-9 lt {-1 /rotval rotval neg def /just just dup 12 and
	4 ne {12 xor} if def} {1} ifelse scale } if /showflag 0 def
	/fspc pspc def /Bline 0 def /Tabs 0 array def /fscale 1.0 def
	/kY 0 def gsave dup 1 add copy 0 exch 1 0 dtransform exch atan rotate
	{exch dup type /stringtype eq {true charpath flattenpath} {exec}
	ifelse } repeat pop pathbbox grestore 3 -1 roll pop 3 1 roll just
	1 and 0 gt {just 2 and 0 gt {exch pop neg fspc sub} {exch sub 0.5
	mul neg} ifelse} {pop neg fspc add} ifelse exch Bline exch just 4
	and 0 gt {just 8 and 0 gt {exch pop neg fspc sub} {add 0.5 mul neg}
	ifelse} {pop neg fspc add} ifelse rotval rotate Kn currentpoint
	translate /showflag 1 def /Bline 0 def /Tabs 0 array def /fscale
	1.0 def /kY 0 def {dup type /stringtype eq {show}{exec} ifelse}
	repeat grestore } def
/pinlabel { 4 index 32 and 0 ne hlevel 0 eq or { /pspc 10 def label
	/pspc 0 def } { pop pop pop pop pop {pop} repeat } ifelse } def
/pinglobal { pinlabel } def
/infolabel { pinlabel } def

/scb { setrgbcolor } bind def  /sce { defColor aload pop scb } bind def
/cRedef {/defColor currentcolor 3 array astore def} def
/begingate { /hlevel hlevel 1 add def /defColor currentcolor sce 3 array
	astore def gsave sce translate 0 0 moveto neg rotate dup abs scale
	} bind def
/makeparm  {3 string cvs dup length 1 add string /tstr exch def tstr exch
	1 exch putinterval tstr 0 (v) putinterval tstr cvn} bind def
/beginparm { -1 1 {makeparm exch def} for
	dup type /arraytype eq { aload length -1 1 {makeparm exch def}
	for } if begingate } bind def
/endgate { /hlevel hlevel 1 sub def grestore defColor aload pop cRedef
	scb} bind def

/hlevel 0 def
/tmpa [1 0 0 1 0 0] def
/gar {8 8 true tmpa {<c0 c0 00 00 0c 0c 00 00>} imagemask} bind
{8 8 true tmpa {<30 70 60 02 03 07 06 20>} imagemask} bind
{8 8 true tmpa {<0c 1e 1e 0c c0 e1 e1 c0>} imagemask} bind
{8 8 true tmpa {<0f 0f 0f 0f f0 f0 f0 f0>} imagemask} bind
{8 8 true tmpa {<3f f3 e1 e1 f3 3f 1e 1e>} imagemask} bind
{8 8 true tmpa {<df cf 8f 9f fd fc f8 f9>} imagemask} bind
{8 8 true tmpa {<ff 3f 3f ff ff f3 f3 ff>} imagemask} bind 7 array astore def
/ppaint { gsave clip tmpa dup setmatrix pathbbox neg exch neg 4 2 roll
  neg 4 -1 roll 2 copy gt {exch} if 8 div ceiling 8 mul 4 2 roll neg 2 copy
  gt {exch} if 8 div ceiling 8 mul 3 -1 roll -8 5 -1 roll
  { 3 index exch 5 exch put dup -8 3 index { 3 index
  exch 4 exch put 3 index exec } for } for pop pop pop pop grestore } bind def
/setstyles {
  currentlinewidth mul setlinewidth /style exch def
  style 1 and 0 gt not {closepath} if
  style 2 and 0 gt {currentlinewidth 4 mul dup 2 array astore 0 setdash} if
  style 4 and 0 gt {0.5 currentlinewidth 4 mul 2 array astore 0 setdash} if
  gsave style 16 and 0 gt { style 224 and -5 bitshift style 256 and 0 gt {
  7 exch sub 8 div dup 1 exch sub currentrgbcolor 3 array astore
  {3 copy mul add 4 1 roll pop} forall pop pop setrgbcolor eofill}
  {dup 7 lt {gar exch get ppaint} {pop eofill} ifelse} ifelse}
  {style 256 and 0 gt {1 setgray eofill} if} ifelse grestore style 8 and 0 gt 
  style 512 eq or {newpath} {stroke} ifelse grestore} def     

/polygon { gsave /num exch def moveto num 1 sub {lineto} repeat setstyles } def
/xcarc   { gsave newpath arc setstyles } def
/elb { matrix currentmatrix 7 -1 roll 7 -1 roll translate 5 1 roll 4 -1 roll
	3 index div 1 scale } def
/ele { 0 4 1 roll 0 4 1 roll } bind def
/ellipse { gsave elb newpath ele arc setmatrix setstyles } def
/pellip  { elb ele arc setmatrix } def
/nellip  { elb ele arcn setmatrix } def
/spline  { gsave moveto curveto setstyles } def
/polyc   { {lineto} repeat } bind def
/beginpath { gsave moveto } bind def
/endpath { setstyles } bind def
/bop	 { 1 setlinecap 0 setlinejoin 6 setmiterlimit 0 0 0 scb cRedef } def
/psinsertion {/PSobj save def /showpage {} def bop rotate translate dup scale} def
/end_insert {PSobj restore} def
/setpagemat {/pagemat matrix currentmatrix def} def
/inchscale  {setpagemat 0.375 mul dup scale} def
/cmscale    {setpagemat 0.35433071 mul dup scale} def

%%EndResource
%%EndProlog

% XCircuit output starts here.

/nand {
% nand is_schematic
begingate
1 1.00 0 -48 -64 -48 -64 48 0 48 4 polygon
1 1.00 56 0 8 0.00 360.00 xcarc
1 1.00 0 0 48 -90.00 90.00 xcarc
1.000 0.000 0.000 scb
(Out) {/Times-Roman cf} 2 4 0 1.00 64 0 pinlabel
(In.1) {/Times-Roman cf} 2 7 0 1.00 -64 32 pinlabel
(In.2) {/Times-Roman cf} 2 7 0 1.00 -64 -32 pinlabel
endgate
} def

/invert {
% invert is_schematic
begingate
0 1.00 -32 -40 -32 40 40 0 3 polygon
1 1.00 48 0 8 0.00 360.00 xcarc
1 1.00 -32 0 -48 0 2 polygon
1 1.00 56 0 64 0 2 polygon
1.000 0.000 0.000 scb
(Out) {/Times-Roman cf} 2 4 0 1.00 64 0 pinlabel
(In) {/Times-Roman cf} 2 7 0 1.00 -48 0 pinlabel
endgate
} def

/dot {
% trivial
begingate
248 1.00 0 0 6 0.00 360.00 xcarc
1.000 0.000 0.000 scb
(x) {/Times-Roman cf} 2 29 0 1.00 0 0 pinlabel
endgate
} def

/circle {
% trivial
begingate
1 1.00 16 0 6 0.00 360.00 xcarc
1 1.00 0 0 10 0 2 polygon
1.000 0.000 0.000 scb
(out) {/Times-Roman cf} 2 4 0 1.00 16 0 pinlabel
(out) {/Times-Roman cf} 2 7 0 1.00 0 0 pinlabel
endgate
} def

%%Page: logic 11
%%PageOrientation: Portrait
/pgsave save def bop
% 912 848 offsets
1.0000 inchscale
2.6000 setlinewidth

1.00 0 944 928 nand
1.00 0 944 1088 nand
1.00 0 656 1120 invert
1 1.00 720 1120 880 1120 2 polygon
1 1.00 608 1120 560 1120 2 polygon
1 1.00 880 1056 784 1056 784 960 880 960 4 polygon
1 1.00 880 896 560 896 2 polygon
1 1.00 784 960 560 960 2 polygon
1.00 0 784 960 dot
1 1.00 1008 1088 1136 1088 2 polygon
1 1.00 1008 928 1136 928 2 polygon
-1.00 0 560 1120 circle
1.00 0 1136 1088 circle
1.00 0 1136 928 circle
-1.00 0 560 896 circle
-1.00 0 560 960 circle
(Logic Circuit) {/Times-Roman cf} 2 9 0 1.00 816 1280 label
0 1.00 304 784 304 1328 1328 1328 1328 784 4 polygon
1.000 0.000 0.000 scb
(Pin.1) {/Times-Roman cf} 2 7 0 1.00 544 1120 pinlabel
(Pin.2) {/Times-Roman cf} 2 7 0 1.00 544 960 pinlabel
(Pin.3) {/Times-Roman cf} 2 7 0 1.00 544 896 pinlabel
(Pin.5) {/Times-Roman cf} 2 4 0 1.00 1152 928 pinlabel
(Pin.4) {/Times-Roman cf} 2 4 0 1.00 1152 1088 pinlabel
pgsave restore showpage

/gnd {
begingate
1 1.00 0 0 0 -32 2 polygon
1 1.00 -32 -32 32 -32 2 polygon
1 1.00 -18 -46 18 -46 2 polygon
1 1.00 -4 -60 4 -60 2 polygon
1.000 0.000 0.000 scb
(GND) {/Times-Roman cf} 2 1 0 1.00 0 0 pinglobal
endgate
} def

/pmos {
begingate
1 1.00 -44 -28 -44 28 2 polygon
1 1.00 -60 0 -64 0 2 polygon
1 1.00 0 -64 0 -28 -32 -28 -32 28 0 28 0 64 6 polygon
1 1.00 -52 0 8 0.00 360.00 xcarc
1.000 0.000 0.000 scb
(S) {/Times-Roman cf} 2 9 0 1.00 0 64 pinlabel
(D) {/Times-Roman cf} 2 13 0 1.00 0 -64 pinlabel
(G) {/Times-Roman cf} 2 7 0 1.00 -64 0 pinlabel
0.180 0.545 0.341 scb
(spice:M%i %pD %pG %pS Vdd pmos) {/Times-Roman cf} 2 4 0 1.00 -196 -139 
infolabel
(sim:p %pG %pS %pD) {/Times-Roman cf} 2 4 0 1.00 -196 -187 infolabel
endgate
} def

/nmos {
begingate
1 1.00 0 -64 0 -28 -32 -28 -32 28 0 28 0 64 6 polygon
1 1.00 -44 -28 -44 28 2 polygon
1 1.00 -44 0 -64 0 2 polygon
1.000 0.000 0.000 scb
(G) {/Times-Roman cf} 2 7 0 1.00 -64 0 pinlabel
(S) {/Times-Roman cf} 2 13 0 1.00 0 -64 pinlabel
(D) {/Times-Roman cf} 2 9 0 1.00 0 64 pinlabel
0.180 0.545 0.341 scb
(spice:M%i %pD %pG %pS GND nmos) {/Times-Roman cf} 2 4 0 1.00 -244 -139 
infolabel
(sim:n %pG %pS %pD) {/Times-Roman cf} 2 4 0 1.00 -244 -187 infolabel
endgate
} def

/jumper {
% trivial
begingate
1 1.00 0 0 10 -90.00 90.00 xcarc
1 1.00 0 10 0 16 2 polygon
1 1.00 0 -10 0 -16 2 polygon
1.000 0.000 0.000 scb
(a) {/Times-Roman cf} 2 1 0 1.00 0 16 pinlabel
(a) {/Times-Roman cf} 2 13 0 1.00 0 -16 pinlabel
endgate
} def

/vdd {
begingate
1 1.00 0 0 0 32 2 polygon
1 1.00 -32 32 32 32 2 polygon
(Vdd) {/Times-Roman cf} 2 17 0 0.90 0 38 label
1.000 0.000 0.000 scb
(Vdd) {/Times-Roman cf} 2 13 0 1.00 0 0 pinglobal
endgate
} def

%%Page: nand 11
%%PageOrientation: Portrait
/pgsave save def bop
% nand is_symbol
% 808 1024 offsets
1.0000 inchscale
2.6000 setlinewidth

1.00 0 808 928 gnd
-1.00 0 872 1248 pmos
-1.00 0 808 992 nmos
1.00 0 808 1120 nmos
1.00 0 744 1248 pmos
1 1.00 744 1184 872 1184 2 polygon
1 1.00 744 1312 872 1312 2 polygon
1 1.00 968 1168 968 992 872 992 3 polygon
1 1.00 872 1184 1016 1184 2 polygon
1 1.00 744 1120 648 1120 648 1248 680 1248 4 polygon
1 1.00 616 1120 648 1120 2 polygon
1 1.00 936 1248 1016 1248 2 polygon
1.00 0 648 1120 dot
1.00 0 808 1184 dot
1.00 0 872 1184 dot
1.00 0 968 1248 dot
1.00 0 808 1312 dot
-1.00 0 616 1120 circle
1.00 0 1016 1248 circle
1.00 0 1016 1184 circle
1 1.00 968 1200 968 1248 2 polygon
1.00 0 968 1184 jumper
(2-Input Nand gate) {/Times-Roman cf} 2 9 0 1.00 808 1440 label
1.00 0 840 752 nand
1 1.00 904 752 936 752 2 polygon
1 1.00 776 784 744 784 2 polygon
1 1.00 776 720 744 720 2 polygon
-1.00 0 744 720 circle
1.00 0 936 752 circle
-1.00 0 744 784 circle
( Out) {/Times-Roman cf} 2 4 0 1.00 952 752 label
(In.1 ) {/Times-Roman cf} 2 7 0 1.00 728 784 label
(In.2 ) {/Times-Roman cf} 2 7 0 1.00 728 720 label
(\(symbol\)) {/Times-Roman cf} 2 5 0 1.00 824 656 label
1 1.00 312 832 1320 832 2 polygon
0 1.00 312 608 312 1504 1320 1504 1320 608 4 polygon
1.000 0.000 0.000 scb
(In.1) {/Times-Roman cf} 2 7 0 1.00 600 1120 pinlabel
(Out) {/Times-Roman cf} 2 4 0 1.00 1032 1184 pinlabel
(In.2) {/Times-Roman cf} 2 4 0 1.00 1032 1248 pinlabel
sce
1.00 0 808 1312 vdd
pgsave restore showpage

%%Page: invert 11
%%PageOrientation: Portrait
/pgsave save def bop
% invert is_symbol
% 832 1176 offsets
1.0000 inchscale
2.6000 setlinewidth

1.00 0 832 1016 gnd
1.00 0 832 1080 nmos
1.00 0 832 1208 pmos
1 1.00 768 1208 768 1208 736 1208 736 1080 768 1080 5 polygon
1 1.00 832 1144 928 1144 2 polygon
1 1.00 736 1144 672 1144 2 polygon
1.00 0 736 1144 dot
1.00 0 832 1144 dot
-1.00 0 672 1144 circle
1.00 0 928 1144 circle
(Inverter) {/Times-Roman cf} 2 9 0 1.00 832 1400 label
1 1.00 864 792 896 792 2 polygon
1 1.00 752 792 720 792 2 polygon
1.00 0 896 792 circle
-1.00 0 720 792 circle
( Out) {/Times-Roman cf} 2 4 0 1.00 912 792 label
(In ) {/Times-Roman cf} 2 7 0 1.00 704 792 label
(\(symbol\)) {/Times-Roman cf} 2 5 0 1.00 816 696 label
1 1.00 512 888 1120 888 2 polygon
0 1.00 512 648 512 1464 1120 1464 1120 648 4 polygon
1.00 0 800 792 invert
1.000 0.000 0.000 scb
(Out) {/Times-Roman cf} 2 4 0 1.00 944 1144 pinlabel
(In) {/Times-Roman cf} 2 7 0 1.00 656 1144 pinlabel
sce
1.00 0 832 1272 vdd
pgsave restore showpage

%%Trailer
XCIRCsave restore
%%EOF
